<template>
	<view>
		<view class="bg-white radius shadow text-center" style="line-height: 3em;" @tap="clickLoadMore" v-if="status==0">
			点击加载更多
		</view>
		<view class="text-center" v-if="status==1">
			<view class="cu-load loading"></view>
		</view>
		<view class="text-center" style="line-height: 3em;" v-if="status==2">
			已经没有更多了~
		</view>
	</view>
</template>

<script>
	const LOAD_STATUS_DEFAULT = 0;
	const LOAD_STATUS_LOADING = 1;
	const LOAD_STATUS_COMPLETE = 2;
	export default {
		data() {
			return {
				status: LOAD_STATUS_DEFAULT
			}
		},
		props: {
			eventClick: {
				type: Function
			}
		},
		methods: {
			clickLoadMore: function() {
				if (this.eventClick) {
					this.eventClick();
				}
			},


			loading: function() {
				this.status = LOAD_STATUS_LOADING;
			},
			loadComplete: function() {
				this.status = LOAD_STATUS_DEFAULT;
			},
			loadEnd: function() {
				this.status = LOAD_STATUS_COMPLETE;
			}
		}

	}
</script>

<style>
</style>
